package com.xishu.entity.shop;

import com.xishu.entity.AbstractEntity;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * 触摸设备
 */
@Entity(name = "touch_device")
@Table(indexes = {@Index(columnList = "shopId")})
public class TouchDevice extends AbstractEntity {
    private static final long serialVersionUID = 7324853474594668601L;

    @ApiModelProperty(value = "唯一ID")
    private String uuid;

    @ApiModelProperty(value = "更新时间")
    private Long updateTime;

    @ApiModelProperty(value = "分店ID")
    private Long shopId;

    @ApiModelProperty(value = "餐厅ID")
    private Long companyId;

    @ApiModelProperty(value = "哪一个账号登录的设备")
    private Long userId;

    @Transient
    @ApiModelProperty(value = "在线或者是离线,3分钟没有更新，算是离线")
    private Boolean online;

    @ApiModelProperty(value = "每一个设备的序列号")
    private Integer showIndex;

    public Long getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Long companyId) {
        this.companyId = companyId;
    }

    public Integer getShowIndex() {
        return showIndex;
    }

    public void setShowIndex(Integer showIndex) {
        this.showIndex = showIndex;
    }

    public Boolean getOnline() {
        return online;
    }

    public void setOnline(Boolean online) {
        this.online = online;
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public Long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Long updateTime) {
        this.updateTime = updateTime;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("TouchDevice{");
        sb.append("uuid='").append(uuid).append('\'');
        sb.append(", updateTime=").append(updateTime);
        sb.append(", shopId=").append(shopId);
        sb.append(", companyId=").append(companyId);
        sb.append(", userId=").append(userId);
        sb.append(", online=").append(online);
        sb.append(", showIndex=").append(showIndex);
        sb.append('}');
        return sb.toString();
    }
}
